//Copyright 2012 Trevin Liberty
//GNU GPL v3
//Author: Trevin Liberty
//
//Holds information regarding the cursor, 
//	cursor's current image, and any sprites used.
#ifndef CURSOR_H
#define CURSOR_H

#include <allegro5\allegro5.h>
#include <allegro5\allegro_image.h>
#include <allegro5/allegro_primitives.h>

#include "Sprite\ClickSprite.h"

//See comment at top of file for a complete description
class Cursor {
private:
	ClickSprite sprite;

	ALLEGRO_DISPLAY* display;
	ALLEGRO_MOUSE_CURSOR* normCursor;
	ALLEGRO_MOUSE_CURSOR* leftClickCursor;
	ALLEGRO_BITMAP* imageLC;

	//True if the user has the left mouse button down.
	//	else false.
	//Used to display the correct cursor image.
	bool lClicked;

public:
	//Constructor
	//	PARAMS:
	//ALLEGRO_DISPLAY* display: The current system display. SEE: Allegro_Misc.h
	Cursor(ALLEGRO_DISPLAY* display);

	//Used when the mouse's left button is pressed.
	void leftDown(Point<float> pos);

	//Used when the mouse's left button is released.
	void leftUp();

	//Used when the mouse's right button is pressed.
	void rightDown(Point<float> pos, Point<float> camPos);

	//Used when the mouse's right button is released.
	void rightUp();

	//Updates the cursor.
	void update();

	//Draws the cursor and any sprites related to it.
	void draw(Point<float> camXY);
};

#endif